import App from "./App";
// import { createApp } from 'vue'
import uviewPlus from 'uview-plus'
import { createPinia } from "pinia";
import tabBar from "./components/tabBar/tabBar.vue";
import basePages from "./components/basePages.vue";
// #ifndef VUE3
import Vue from "vue";
import "./uni.promisify.adaptor";
Vue.config.productionTip = false;
App.mpType = "app";
const app = new Vue({
  ...App,
});

app.$mount();
// #endif

// #ifdef VUE3
import { createSSRApp } from "vue";

export function createApp() {
  const app = createSSRApp(App);
  const pinia = createPinia();

  app.use(pinia);
  app.use(uviewPlus);
  
  // 注册自定义组件
  app.component("tabBar", tabBar);
  app.component("basePages", basePages);
  
  // 解决up-text未注册的问题
  app.config.compilerOptions = {
    isCustomElement: (tag) => tag.includes('up-') || tag.includes('u-')
  };
  
  // 初始化uview-plus
  uni.$u = {
    props: {
      // 全局配置
    }
  };

  return {
    app,
    pinia,
  };
}
// #endif
